package com.androidx.p013lv.mine.model;

import android.content.Context;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.androidx.p013lv.base.http.BaseRes;
import com.androidx.p013lv.base.http.HttpUtils;
import com.androidx.p013lv.base.http.UrlManager;
import com.androidx.p013lv.base.http.callback.HttpCallback;
import com.androidx.p013lv.mine.bean.ShareBean;

/* renamed from: com.androidx.lv.mine.model.ShareModel */
public class ShareModel extends ViewModel {
    private MutableLiveData<BaseRes<ShareBean>> shareBean;

    public MutableLiveData<BaseRes<ShareBean>> shareData(int i, Context context) {
        if (this.shareBean == null) {
            this.shareBean = new MutableLiveData<>();
            getShareData(i, context);
        }
        return this.shareBean;
    }

    private void getShareData(int i, Context context) {
        HttpUtils.getInsatance().get(UrlManager.getInsatance().shareLink(i), new HttpCallback<BaseRes<ShareBean>>("shareData", context) {
            /* class com.androidx.p013lv.mine.model.ShareModel.C13661 */

            public void onLvSuccess(BaseRes<ShareBean> baseRes) {
                ShareModel.this.shareBean.setValue(baseRes);
            }
        });
    }

    public void cancelHttp() {
        HttpUtils.getInsatance().cancelTag("shareData");
        super.onCleared();
    }
}
